﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="news.aspx.cs" validaterequest="false" Inherits="WebApplication.admin.News" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="x-ua-compatible" content="ie=7" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="style.css" rel="stylesheet" type="text/css" />
<title></title>
</head>
<body>
<% if (isadd) { %>
<form class="form root" action="?do=save&id=<%= id %>&start=<%= start %>&limit=<%= limit %>" method="post">
    <h3><asp:literal text="添加" runat="server" id="lit_action" />新闻</h3>
    <div class="item"><label for="title">标题:</label><input name="title" type="text" class="text" id="title" runat="server" size="60"></div>
    <div class="item"><label for="tags">标签:</label><input name="tags" type="text" class="text" id="tags" runat="server" size="60"></div>
    <div class="item"><label>内容:</label><textarea name="content" id="content" runat="server"></textarea></div>
    <div class="item"><label>&nbsp;</label><input type="submit" id="btn_save" runat="server" class="btn" value="添加" /></div>
</form>
<script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
<script type="text/javascript">
    CKEDITOR.replace('content');
</script>
<% } else { %>
<table border="0" cellpadding="1" cellspacing="1" class="grid">
    <thead>
        <tr>
            <th width="60" style="text-align:center">编号</th>
            <th width="160">类别</th>
            <th>标题</th>
            <th width="160">发布时间</th>
            <th width="120">操作</th>
        </tr>
    </thead>
    <tbody>
        <asp:repeater runat="server" id="news_list">
            <itemtemplate>
        <tr>
            <td align="center"><%# DataBinder.Eval(Container.DataItem,"Id") %></td>
            <td><%# DataBinder.Eval(Container.DataItem,"NewsType.Name") %></td>
            <td><a target="_blank" href="../news.aspx?id=<%# DataBinder.Eval(Container.DataItem,"Id") %>"><%# DataBinder.Eval(Container.DataItem,"Title") %></a></td>
            <td><%# DataBinder.Eval(Container.DataItem,"AddTime") %></td>
            <td>
                <a href="?do=edit&id=<%# DataBinder.Eval(Container.DataItem,"Id") %>&start=<%= start %>&limit=<%= limit %>">修改</a>
                <a href="?do=delete&id=<%# DataBinder.Eval(Container.DataItem,"Id") %>&start=<%= start %>&limit=<%= limit %>" onclick="return confirm('确定删除?')">删除</a>
            </td>
        </tr>
            </itemtemplate>
        </asp:repeater>
    </tbody>
    <tfoot>
        <tr>
            <td colspan="5">
                <qsl:pager runat="server" limit="10" id="n_pager" />
            </td>
        </tr>
    </tfoot>
</table>
<% } %>
</body>
</html>
